Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jul 22, 2025

Description

This pull request introduces significant updates to the workflow and script for automating the process of updating font data. The changes improve functionality, add clarity, and enhance error handling. Key updates include adjustments to permissions, modifications to the GitHub Actions workflow, and a major overhaul of the Update-FontsData.ps1 script to streamline Git operations and improve logging.

Workflow updates:

  • .github/workflows/Update-FontsData.yml: Updated permissions to include contents: write and pull-requests: write, enabling the workflow to push changes and create pull requests.
  • .github/workflows/Update-FontsData.yml: Added fetch-depth: 0 to the repository checkout step, ensuring all history is fetched for operations requiring full commit history. Removed unused ClientID and PrivateKey inputs from the Update-FontsData job.

Script enhancements:

  • scripts/Update-FontsData.ps1: Replaced raw Git commands with a new Invoke-NativeCommand function for executing native commands, improving error handling and debugging capabilities.
  • scripts/Update-FontsData.ps1: Enhanced branch management logic to dynamically switch between default and feature branches based on context, ensuring proper handling of updates and pull requests.
  • scripts/Update-FontsData.ps1: Improved logging and added detailed output for changes, commits, and diffs, providing better visibility into the update process.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Copilot AI review requested due to automatic review settings July 22, 2025 07:22
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner July 22, 2025 07:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the font data update workflow by removing dependencies on the GitHub App authentication and introducing a new native command wrapper. The changes simplify the script execution by using standard git operations instead of app-based authentication.

  • Introduces Invoke-NativeCommand function to standardize native command execution with error handling
  • Updates workflow permissions and removes GitHub App authentication requirements
  • Removes the "Agave" font entry from the fonts data

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/FontsData.json Removes the "Agave" font entry from the available fonts list
scripts/Update-FontsData.ps1 Adds Invoke-NativeCommand function and refactors git commands to use it instead of direct calls
.github/workflows/Update-FontsData.yml Updates permissions and removes GitHub App authentication parameters

@MariusStorhaug MariusStorhaug changed the title Ghtok 🩹 [Patch]: Switch to use GITHUB_TOKEN for updates Jul 22, 2025
@MariusStorhaug MariusStorhaug self-assigned this Jul 22, 2025
@MariusStorhaug MariusStorhaug merged commit 322526e into main Jul 22, 2025
2 checks passed
@MariusStorhaug MariusStorhaug deleted the ghtok branch July 22, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🩹 [Patch]: Update "Update-FontData" workflow to use GITHUB_TOKEN

2 participants